Skip to content

try to speedup cache#663

Merged
AlexInLog merged 2 commits into
v2from
speedup_cache
Oct 14, 2024
Merged

try to speedup cache#663
AlexInLog merged 2 commits into
v2from
speedup_cache

Conversation

@AlexInLog

@AlexInLog AlexInLog commented Oct 14, 2024

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Chores
    • Updated workflow configurations to enhance caching mechanisms for dependencies.
    • Improved cache accuracy by modifying cache keys to include additional hash from CMakePresets.json.
    • Introduced conditional execution in jobs based on cache checks, optimizing workflow efficiency.

@coderabbitai

coderabbitai Bot commented Oct 14, 2024

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The pull request updates the workflow configurations in .github/workflows/analyzers.yml and .github/workflows/ci v2.yml to enhance caching mechanisms for dependencies across multiple jobs. The cache keys have been modified to include a hash based on the CMakePresets.json file, which improves cache accuracy. Additionally, the cache_deps job has undergone several modifications, including renaming steps, adding identifiers, and implementing conditional execution based on cache checks.

Changes

File Path Change Summary
.github/workflows/analyzers.yml Updated cache keys for pvs and sonarcloud_and_coverage jobs to include CMakePresets.json hash.
.github/workflows/ci v2.yml Modified cache_deps job: renamed caching step, added step ID, updated cache key, introduced lookup-only option, and added conditional execution for subsequent steps.

Poem

In the land of code where bunnies play,
Caching's improved, hip-hip-hooray! 🐇✨
With presets in tow, our jobs are so spry,
No more missed caches, oh my, oh my!
Hopping through workflows, swift as a breeze,
Let's celebrate changes with joyful ease! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (2)
.github/workflows/analyzers.yml (1)

Line range hint 1-165: Consider further cache optimization

The changes made to include CMakePresets.json in the cache keys are beneficial. To potentially further optimize caching, consider the following suggestion:

You could split the cache into two separate caches: one for Conan dependencies and another for CMake-related files. This approach might provide more granular control over what gets invalidated when either Conan dependencies or CMake presets change.

Example:

- name: Cache Conan dependencies
  uses: actions/cache@v4
  with:
    path: ~/.conan2
    key: conan-deps-${{ runner.os }}-${{ hashFiles('**/conanfile.py') }}

- name: Cache CMake files
  uses: actions/cache@v4
  with:
    path: build
    key: cmake-${{ runner.os }}-${{ hashFiles('**/CMakePresets.json') }}

This separation could potentially lead to fewer full rebuilds, as changes to CMake presets wouldn't invalidate the Conan dependency cache, and vice versa.

.github/workflows/ci v2.yml (1)

194-194: Consistent caching strategy applied with room for improvement

The update to include the hash of CMakePresets.json in the cache key for the tests job maintains consistency with the changes made in other jobs. This ensures a uniform caching strategy across the workflow.

However, consider adding conditional execution for the conan detect profile and Run CMake steps in this job, similar to the cache_deps job. This could further optimize the workflow by skipping these steps when the cache is hit.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 16fe752 and d372d79.

📒 Files selected for processing (2)
  • .github/workflows/analyzers.yml (2 hunks)
  • .github/workflows/ci v2.yml (3 hunks)
🧰 Additional context used
🔇 Additional comments (5)
.github/workflows/analyzers.yml (2)

42-42: Improved cache key for better accuracy

The addition of CMakePresets.json to the cache key is a good improvement. This ensures that the cache is invalidated when CMake presets change, which could affect the build. This change aligns well with the PR objective of speeding up the cache by reducing cache misses when CMake configurations change.


115-115: Consistent cache key improvement across jobs

This change is consistent with the improvement made in the pvs job. Adding CMakePresets.json to the cache key in the sonarcloud_and_coverage job ensures consistent behavior across different parts of the workflow. This consistency is good for maintainability and helps achieve the PR's objective of speeding up the cache uniformly.

.github/workflows/ci v2.yml (3)

56-73: Excellent improvements to the caching mechanism!

The changes in the cache_deps job are well-implemented and should significantly improve the workflow efficiency:

  1. Renaming the step to "check cache" and adding an ID improves clarity and allows for conditional execution.
  2. Including the hash of CMakePresets.json in the cache key enhances cache accuracy.
  3. The lookup-only: true option allows for checking cache existence without restoration, potentially saving time.
  4. Conditional execution of subsequent steps based on cache hit status prevents unnecessary work.

These optimizations should lead to faster builds and more efficient use of GitHub Actions resources.


117-117: Consistent caching strategy applied

The update to include the hash of CMakePresets.json in the cache key for the sanitize job is consistent with the changes made in other jobs. This ensures a uniform caching strategy across the workflow.


Line range hint 1-294: Overall excellent improvements to workflow efficiency

The changes made across the workflow file are well-aligned with the PR objective of speeding up the cache. Key improvements include:

  1. Consistent use of CMakePresets.json hash in cache keys across all jobs.
  2. Introduction of cache lookup-only and conditional execution in the cache_deps job.
  3. Maintaining the overall structure of the workflow while optimizing critical parts.

These changes should lead to faster builds and more efficient use of GitHub Actions resources. Great job on improving the workflow!

To further enhance the improvements:

  1. Consider applying the conditional execution strategy used in the cache_deps job to other jobs like tests and sanitize.
  2. After merging these changes, monitor the workflow run times and cache hit rates to quantify the improvements and identify any areas for further optimization.

To verify the impact of these changes, you can run the following script after merging:

This script will help quantify the impact of the caching improvements on overall workflow execution time.

@github-actions

Copy link
Copy Markdown
Contributor

BENCHMARK RESULTS (AUTOGENERATED)

ci-ubuntu-gcc

General

name rxcpp rpp prev rpp ratio
Subscribe empty callbacks to empty observable 300.44 ns 2.16 ns 2.16 ns 1.00
Subscribe empty callbacks to empty observable via pipe operator 307.61 ns 2.16 ns 2.16 ns 1.00

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 740.24 ns 0.31 ns 0.31 ns 1.00
from array of 1 - create + subscribe + current_thread 1049.96 ns 3.71 ns 3.71 ns 1.00
concat_as_source of just(1 immediate) create + subscribe 2317.89 ns 142.75 ns 144.18 ns 0.99
defer from array of 1 - defer + create + subscribe + immediate 757.40 ns 0.31 ns 0.31 ns 1.00
interval - interval + take(3) + subscribe + immediate 2174.58 ns 59.23 ns 59.59 ns 0.99
interval - interval + take(3) + subscribe + current_thread 3067.19 ns 32.45 ns 32.40 ns 1.00
from array of 1 - create + as_blocking + subscribe + new_thread 29058.08 ns 27339.36 ns 27714.29 ns 0.99
from array of 1000 - create + as_blocking + subscribe + new_thread 40153.42 ns 50962.10 ns 50450.63 ns 1.01
concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe 3537.69 ns 217.42 ns 215.76 ns 1.01

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 1140.35 ns 0.31 ns 0.31 ns 1.00
immediate_just+filter(true)+subscribe 875.77 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2)+skip(1)+subscribe 1006.18 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,1,2)+distinct_until_changed()+subscribe 915.70 ns 0.31 ns 0.31 ns 0.99
immediate_just(1,2)+first()+subscribe 1258.37 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2)+last()+subscribe 925.45 ns 0.31 ns 0.31 ns 0.99
immediate_just+take_last(1)+subscribe 1145.98 ns 18.22 ns 19.02 ns 0.96
immediate_just(1,2,3)+element_at(1)+subscribe 883.50 ns 0.31 ns 0.31 ns 1.00

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 271.35 ns 2.16 ns 5.31 ns 0.41
current_thread scheduler create worker + schedule 384.48 ns 5.87 ns 10.32 ns 0.57
current_thread scheduler create worker + schedule + recursive schedule 810.55 ns 55.64 ns 63.33 ns 0.88

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 869.62 ns 0.31 ns 0.32 ns 0.97
immediate_just+scan(10, std::plus)+subscribe 895.61 ns 0.31 ns 0.31 ns 1.00
immediate_just+flat_map(immediate_just(v*2))+subscribe 2335.44 ns 193.03 ns 252.76 ns 0.76
immediate_just+buffer(2)+subscribe 1538.32 ns 13.90 ns 13.90 ns 1.00
immediate_just+window(2)+subscribe + subscsribe inner 2367.97 ns 1320.91 ns 1692.57 ns 0.78

Conditional Operators

name rxcpp rpp prev rpp ratio
immediate_just+take_while(false)+subscribe 911.25 ns - - 0.00
immediate_just+take_while(true)+subscribe 915.62 ns 0.31 ns 0.32 ns 0.95

Utility Operators

name rxcpp rpp prev rpp ratio
immediate_just(1)+subscribe_on(immediate)+subscribe 2076.27 ns 0.31 ns 0.71 ns 0.43

Combining Operators

name rxcpp rpp prev rpp ratio
immediate_just(immediate_just(1), immediate_just(1)) + merge() + subscribe 3409.27 ns 236.14 ns 301.54 ns 0.78
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 3737.79 ns 191.43 ns 199.66 ns 0.96
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 181.65 ns 335.78 ns 0.54
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 3554.16 ns 1158.93 ns 1540.45 ns 0.75
immediate_just(1) + zip(immediate_just(2)) + subscribe 2110.91 ns 225.33 ns 240.04 ns 0.94

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 34.46 ns 14.72 ns 14.64 ns 1.01
subscribe 100 observers to publish_subject 198717.67 ns 16616.73 ns 25168.62 ns 0.66
100 on_next to 100 observers to publish_subject 27104.60 ns 20244.45 ns 18569.77 ns 1.09

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 1408.30 ns 12.66 ns 12.66 ns 1.00
basic sample with immediate scheduler 1420.20 ns 5.55 ns 5.55 ns 1.00

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 917.15 ns 0.31 ns 0.31 ns 1.00

Error Handling Operators

name rxcpp rpp prev rpp ratio
create(on_next(1), on_error())+on_error_resume_next(immediate_just(2)))+subscribe 2072.23 ns 917.91 ns 965.13 ns 0.95
create(on_error())+retry(1)+subscribe 624.78 ns 121.55 ns 122.00 ns 1.00

ci-macos

General

name rxcpp rpp prev rpp ratio
Subscribe empty callbacks to empty observable 1078.50 ns 4.34 ns 7.47 ns 0.58
Subscribe empty callbacks to empty observable via pipe operator 1078.35 ns 4.32 ns 15.00 ns 0.29

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 2128.05 ns 0.26 ns 0.85 ns 0.30
from array of 1 - create + subscribe + current_thread 2682.25 ns 36.87 ns 206.48 ns 0.18
concat_as_source of just(1 immediate) create + subscribe 8867.91 ns 704.29 ns 622.39 ns 1.13
defer from array of 1 - defer + create + subscribe + immediate 3441.50 ns 0.28 ns 0.41 ns 0.68
interval - interval + take(3) + subscribe + immediate 5513.77 ns 134.27 ns 149.45 ns 0.90
interval - interval + take(3) + subscribe + current_thread 8055.59 ns 106.80 ns 130.42 ns 0.82
from array of 1 - create + as_blocking + subscribe + new_thread 109635.44 ns 101020.18 ns 3226289.00 ns 0.03
from array of 1000 - create + as_blocking + subscribe + new_thread 128264.33 ns 119832.80 ns 1284963.00 ns 0.09
concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe 10127.71 ns 869.79 ns 825.61 ns 1.05

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 3186.73 ns 0.26 ns 0.34 ns 0.76
immediate_just+filter(true)+subscribe 2348.97 ns 0.26 ns 1.30 ns 0.20
immediate_just(1,2)+skip(1)+subscribe 3066.11 ns 0.26 ns 0.38 ns 0.68
immediate_just(1,1,2)+distinct_until_changed()+subscribe 2315.18 ns 0.52 ns 4.20 ns 0.12
immediate_just(1,2)+first()+subscribe 3588.52 ns 0.26 ns 0.85 ns 0.30
immediate_just(1,2)+last()+subscribe 2681.04 ns 0.26 ns 1.27 ns 0.20
immediate_just+take_last(1)+subscribe 3356.30 ns 0.26 ns 1.33 ns 0.19
immediate_just(1,2,3)+element_at(1)+subscribe 2471.31 ns 0.26 ns 1.31 ns 0.20

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 944.24 ns 5.75 ns 5.44 ns 1.06
current_thread scheduler create worker + schedule 1312.47 ns 40.13 ns 51.23 ns 0.78
current_thread scheduler create worker + schedule + recursive schedule 2206.26 ns 222.56 ns 266.40 ns 0.84

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 2330.68 ns 4.89 ns 5.78 ns 0.85
immediate_just+scan(10, std::plus)+subscribe 2582.36 ns 0.52 ns 0.60 ns 0.85
immediate_just+flat_map(immediate_just(v*2))+subscribe 5915.21 ns 740.90 ns 522.72 ns 1.42
immediate_just+buffer(2)+subscribe 2795.19 ns 71.21 ns 68.00 ns 1.05
immediate_just+window(2)+subscribe + subscsribe inner 6064.54 ns 2634.12 ns 3206.55 ns 0.82

Conditional Operators

name rxcpp rpp prev rpp ratio
immediate_just+take_while(false)+subscribe 2315.86 ns - - 0.00
immediate_just+take_while(true)+subscribe 2331.49 ns 0.26 ns 0.31 ns 0.83

Utility Operators

name rxcpp rpp prev rpp ratio
immediate_just(1)+subscribe_on(immediate)+subscribe 5491.44 ns 5.41 ns 6.87 ns 0.79

Combining Operators

name rxcpp rpp prev rpp ratio
immediate_just(immediate_just(1), immediate_just(1)) + merge() + subscribe 8235.34 ns 654.67 ns 689.77 ns 0.95
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 9290.61 ns 561.44 ns 1515.69 ns 0.37
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 653.87 ns 1794.92 ns 0.36
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 8799.28 ns 2104.88 ns 5748.71 ns 0.37
immediate_just(1) + zip(immediate_just(2)) + subscribe 5695.84 ns 1002.44 ns 4657.14 ns 0.22

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 84.10 ns 54.05 ns 84.78 ns 0.64
subscribe 100 observers to publish_subject 390505.33 ns 45786.91 ns 59110.00 ns 0.77
100 on_next to 100 observers to publish_subject 58802.05 ns 21225.62 ns 50365.86 ns 0.42

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 3087.70 ns 74.91 ns 281.20 ns 0.27
basic sample with immediate scheduler 3109.91 ns 20.08 ns 56.23 ns 0.36

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 2656.11 ns 0.26 ns 0.32 ns 0.82

Error Handling Operators

name rxcpp rpp prev rpp ratio
create(on_next(1), on_error())+on_error_resume_next(immediate_just(2)))+subscribe 7200.31 ns 4322.53 ns 4974.96 ns 0.87
create(on_error())+retry(1)+subscribe 2047.97 ns 405.03 ns 519.21 ns 0.78

ci-ubuntu-clang

General

name rxcpp rpp prev rpp ratio
Subscribe empty callbacks to empty observable 266.17 ns 1.54 ns 1.54 ns 1.00
Subscribe empty callbacks to empty observable via pipe operator 264.63 ns 1.54 ns 1.54 ns 1.00

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 558.76 ns 0.31 ns 0.31 ns 1.00
from array of 1 - create + subscribe + current_thread 789.46 ns 4.02 ns 4.01 ns 1.00
concat_as_source of just(1 immediate) create + subscribe 2346.49 ns 185.65 ns 187.18 ns 0.99
defer from array of 1 - defer + create + subscribe + immediate 769.03 ns 0.31 ns 0.31 ns 1.00
interval - interval + take(3) + subscribe + immediate 2212.98 ns 58.31 ns 58.30 ns 1.00
interval - interval + take(3) + subscribe + current_thread 3165.47 ns 30.88 ns 30.88 ns 1.00
from array of 1 - create + as_blocking + subscribe + new_thread 30775.78 ns 28234.81 ns 28417.28 ns 0.99
from array of 1000 - create + as_blocking + subscribe + new_thread 40543.54 ns 38314.88 ns 35287.29 ns 1.09
concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe 3707.70 ns 301.39 ns 307.41 ns 0.98

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 1131.93 ns 0.31 ns 0.31 ns 1.00
immediate_just+filter(true)+subscribe 840.76 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2)+skip(1)+subscribe 1066.84 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,1,2)+distinct_until_changed()+subscribe 868.09 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2)+first()+subscribe 1369.67 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2)+last()+subscribe 991.52 ns 0.31 ns 0.31 ns 1.00
immediate_just+take_last(1)+subscribe 1263.76 ns 0.31 ns 0.31 ns 1.00
immediate_just(1,2,3)+element_at(1)+subscribe 860.41 ns 0.31 ns 0.31 ns 1.00

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 276.48 ns 1.54 ns 1.54 ns 1.00
current_thread scheduler create worker + schedule 386.69 ns 4.56 ns 4.59 ns 0.99
current_thread scheduler create worker + schedule + recursive schedule 845.80 ns 55.91 ns 55.55 ns 1.01

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 848.15 ns 0.31 ns 0.31 ns 1.00
immediate_just+scan(10, std::plus)+subscribe 958.61 ns 0.31 ns 0.31 ns 1.00
immediate_just+flat_map(immediate_just(v*2))+subscribe 2231.74 ns 226.88 ns 228.46 ns 0.99
immediate_just+buffer(2)+subscribe 1593.21 ns 13.59 ns 13.58 ns 1.00
immediate_just+window(2)+subscribe + subscsribe inner 2425.37 ns 928.83 ns 932.76 ns 1.00

Conditional Operators

name rxcpp rpp prev rpp ratio
immediate_just+take_while(false)+subscribe 831.43 ns - - 0.00
immediate_just+take_while(true)+subscribe 847.28 ns 0.31 ns 0.31 ns 0.99

Utility Operators

name rxcpp rpp prev rpp ratio
immediate_just(1)+subscribe_on(immediate)+subscribe 2013.93 ns 0.31 ns 0.31 ns 1.00

Combining Operators

name rxcpp rpp prev rpp ratio
immediate_just(immediate_just(1), immediate_just(1)) + merge() + subscribe 3267.25 ns 290.46 ns 290.63 ns 1.00
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 3760.46 ns 215.25 ns 216.09 ns 1.00
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 197.80 ns 198.44 ns 1.00
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 3380.83 ns 840.51 ns 841.94 ns 1.00
immediate_just(1) + zip(immediate_just(2)) + subscribe 2185.02 ns 197.39 ns 198.22 ns 1.00

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 63.22 ns 29.55 ns 18.25 ns 1.62
subscribe 100 observers to publish_subject 210825.20 ns 19657.04 ns 16040.67 ns 1.23
100 on_next to 100 observers to publish_subject 45997.09 ns 20477.67 ns 20793.16 ns 0.98

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 1295.07 ns 11.42 ns 11.42 ns 1.00
basic sample with immediate scheduler 1280.66 ns 6.17 ns 6.17 ns 1.00

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 993.43 ns 0.31 ns 0.31 ns 1.00

Error Handling Operators

name rxcpp rpp prev rpp ratio
create(on_next(1), on_error())+on_error_resume_next(immediate_just(2)))+subscribe 2188.68 ns 1010.83 ns 1004.24 ns 1.01
create(on_error())+retry(1)+subscribe 649.20 ns 158.77 ns 162.55 ns 0.98

ci-windows

General

name rxcpp rpp prev rpp ratio
Subscribe empty callbacks to empty observable 556.15 ns 4.02 ns 5.32 ns 0.76
Subscribe empty callbacks to empty observable via pipe operator 571.48 ns 4.01 ns 5.21 ns 0.77

Sources

name rxcpp rpp prev rpp ratio
from array of 1 - create + subscribe + immediate 1165.64 ns 9.72 ns 10.29 ns 0.94
from array of 1 - create + subscribe + current_thread 1436.10 ns 17.90 ns 19.39 ns 0.92
concat_as_source of just(1 immediate) create + subscribe 3716.67 ns 232.18 ns 235.61 ns 0.99
defer from array of 1 - defer + create + subscribe + immediate 1190.46 ns 9.42 ns 9.57 ns 0.98
interval - interval + take(3) + subscribe + immediate 3693.87 ns 145.55 ns 149.93 ns 0.97
interval - interval + take(3) + subscribe + current_thread 3459.42 ns 65.11 ns 71.19 ns 0.91
from array of 1 - create + as_blocking + subscribe + new_thread 120312.50 ns 114330.00 ns 125233.33 ns 0.91
from array of 1000 - create + as_blocking + subscribe + new_thread 128933.33 ns 131077.78 ns 152742.86 ns 0.86
concat_as_source of just(1 immediate) and just(1,2 immediate)create + subscribe 5321.83 ns 307.21 ns 306.46 ns 1.00

Filtering Operators

name rxcpp rpp prev rpp ratio
immediate_just+take(1)+subscribe 1808.80 ns 25.30 ns 24.99 ns 1.01
immediate_just+filter(true)+subscribe 1302.29 ns 24.37 ns 24.05 ns 1.01
immediate_just(1,2)+skip(1)+subscribe 1991.47 ns 24.07 ns 23.45 ns 1.03
immediate_just(1,1,2)+distinct_until_changed()+subscribe 1333.99 ns 29.01 ns 26.23 ns 1.11
immediate_just(1,2)+first()+subscribe 2045.24 ns 22.83 ns 23.74 ns 0.96
immediate_just(1,2)+last()+subscribe 1776.52 ns 24.07 ns 24.67 ns 0.98
immediate_just+take_last(1)+subscribe 1998.57 ns 70.41 ns 70.26 ns 1.00
immediate_just(1,2,3)+element_at(1)+subscribe 1330.09 ns 27.46 ns 26.54 ns 1.03

Schedulers

name rxcpp rpp prev rpp ratio
immediate scheduler create worker + schedule 475.07 ns 6.18 ns 6.42 ns 0.96
current_thread scheduler create worker + schedule 649.46 ns 13.88 ns 18.11 ns 0.77
current_thread scheduler create worker + schedule + recursive schedule 1087.69 ns 103.26 ns 108.63 ns 0.95

Transforming Operators

name rxcpp rpp prev rpp ratio
immediate_just+map(v*2)+subscribe 1304.81 ns 24.37 ns 24.37 ns 1.00
immediate_just+scan(10, std::plus)+subscribe 1444.62 ns 26.56 ns 26.53 ns 1.00
immediate_just+flat_map(immediate_just(v*2))+subscribe 3476.74 ns 266.79 ns 273.06 ns 0.98
immediate_just+buffer(2)+subscribe 2614.83 ns 69.88 ns 69.87 ns 1.00
immediate_just+window(2)+subscribe + subscsribe inner 4042.05 ns 1323.24 ns 1318.21 ns 1.00

Conditional Operators

name rxcpp rpp prev rpp ratio
immediate_just+take_while(false)+subscribe 1605.15 ns 23.14 ns 23.12 ns 1.00
immediate_just+take_while(true)+subscribe 1306.20 ns 24.37 ns 24.06 ns 1.01

Utility Operators

name rxcpp rpp prev rpp ratio
immediate_just(1)+subscribe_on(immediate)+subscribe 3460.24 ns 11.11 ns 11.11 ns 1.00

Combining Operators

name rxcpp rpp prev rpp ratio
immediate_just(immediate_just(1), immediate_just(1)) + merge() + subscribe 4931.92 ns 306.86 ns 313.84 ns 0.98
immediate_just(1) + merge_with(immediate_just(2)) + subscribe 5388.57 ns 264.79 ns 267.19 ns 0.99
immediate_just(1) + with_latest_from(immediate_just(2)) + subscribe - 307.17 ns 337.38 ns 0.91
immediate_just(immediate_just(1),immediate_just(1)) + switch_on_next() + subscribe 5267.86 ns 952.22 ns 934.57 ns 1.02
immediate_just(1) + zip(immediate_just(2)) + subscribe 3564.29 ns 575.93 ns 563.32 ns 1.02

Subjects

name rxcpp rpp prev rpp ratio
publish_subject with 1 observer - on_next 37.70 ns 19.98 ns 20.04 ns 1.00
subscribe 100 observers to publish_subject 256350.00 ns 26769.77 ns 28373.81 ns 0.94
100 on_next to 100 observers to publish_subject 54842.11 ns 32648.39 ns 32651.61 ns 1.00

Scenarios

name rxcpp rpp prev rpp ratio
basic sample 1890.27 ns 101.85 ns 102.06 ns 1.00
basic sample with immediate scheduler 1918.73 ns 74.21 ns 72.36 ns 1.03

Aggregating Operators

name rxcpp rpp prev rpp ratio
immediate_just+reduce(10, std::plus)+subscribe 1446.64 ns 24.99 ns 24.66 ns 1.01

Error Handling Operators

name rxcpp rpp prev rpp ratio
create(on_next(1), on_error())+on_error_resume_next(immediate_just(2)))+subscribe 2136.42 ns 243.12 ns 248.54 ns 0.98
create(on_error())+retry(1)+subscribe 1462.82 ns 193.95 ns 190.31 ns 1.02

@AlexInLog AlexInLog merged commit f9662b4 into v2 Oct 14, 2024
@AlexInLog AlexInLog deleted the speedup_cache branch October 14, 2024 16:42
@codecov

codecov Bot commented Oct 14, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.28%. Comparing base (16fe752) to head (d372d79).
Report is 1 commits behind head on v2.

Additional details and impacted files
@@           Coverage Diff           @@
##               v2     #663   +/-   ##
=======================================
  Coverage   98.28%   98.28%           
=======================================
  Files         154      154           
  Lines        7717     7717           
=======================================
  Hits         7585     7585           
  Misses        132      132           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sonarqubecloud

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot mentioned this pull request Oct 16, 2024
@coderabbitai coderabbitai Bot mentioned this pull request Nov 22, 2024
@coderabbitai coderabbitai Bot mentioned this pull request Dec 2, 2024
This was referenced Sep 3, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant